package com.hm.manage.pach;
import lombok.extern.slf4j.Slf4j;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.springframework.stereotype.Component;

import java.io.IOException;

@Slf4j
@Component
public class JsoupTest1 {
    public String scrapeDta() throws IOException {
        String url = "https://50.58.191.80/portal/config";
        Document document = Jsoup.connect(url)
                .userAgent("Mozart/5.0")
                .timeout(5000)
                .get();

        Elements eles = document.select("span.el-submenu__title--text");
        for (Element element : eles) {
            String text = element.text();
            log.info("====================={}", text);
        }

        return "";
    }
}
